<!--
 * @Author: Dorange.Wang
 * @Date: 2021-07-14 13:49:40
 * @LastEditors: your name
 * @LastEditTime: 2021-07-19 17:00:34
 * @Description: file content
-->
<template>
  <van-field
    rows="3"
    autosize
    type="textarea"
    :label="instance.__config.label"
    :placeholder="instance.__config.placeholder"
    :maxlength="instance.__config.maxlength"
    show-word-limit
    :value="value"
    @input="handleValueChange"
  />
</template>

<script>
import { widgetMixin } from "../mixin";
export default {
  mixins: [widgetMixin],
  
  data() {
    return {
      value: "",
    };
  },

  watch: {
    values: {
      handler: "handleValuesChange",
      immediate: true,
      deep: true,
    },
  },

  methods: {
    handleValuesChange(values) {
      this.value = values[this.field];
    },

    handleValueChange(value) {
      this.valueCallback(this.field, value);
    },
  },
};
</script>

<style></style>
